<template>
  <div id="app">
    <template v-if="route.path.startsWith('/user')">
      <router-view />
    </template>
    <template v-else>
      <BasicLayout />
    </template>
  </div>
</template>

<style>
#app {
}
</style>
<script setup lang="ts">
import BasicLayout from "@/layouts/BasicLayout.vue";
import { onMounted } from "vue";
import { useRoute } from "vue-router";
import axios from "axios";

const route = useRoute();

/**
 * 全局初始化函数
 */
const doInit = () => {
  console.log("欢迎来到程崎oj系统");
};

onMounted(async () => {
  doInit();
  // const res = axios.get("https://120.48.83.118/api/health/check");
  // const res = await axios.post("https://120.48.83.118/api/sync/sync/pre");
  // console.log("assaas", res);
  // fetch("https://120.48.83.118/api/health/check")
  //   .then((response) => response.json())
  //   .then((data) => console.log(data));
  fetch("https://120.48.83.118/api/sync/sync/pre", {
    method: "POST",
  })
    .then((response) => response.json())
    .then((data) => console.log(data));
});
</script>
